<?php

namespace app\api\validate;

use think\Validate;

class Space extends Validate
{
    protected $failException = true;

    protected $rule = [
        'name' => 'require|unique:space',
        'remarks' => 'require',
        'tel'   => 'require|mobile',
        'address'  => 'require',
        'wx' =>'require',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'edit'             => ['username', 'nickname', 'birthday'],
        'changePassword'   => ['password'],
        'retrievePassword' => ['account', 'captcha', 'password'],
    ];

    public function __construct()
    {
        $this->field   = [
        	'name' =>'名称',
        	'address' => '地址',
            'remarks'=>'备注',
            'tel'   => '手机',
            'wx' => '微信'
        ];
        $this->message = array_merge($this->message, [
            'nickname.chsDash' => __('nicknameChsDash'),
            'password.regex'   => __('Please input correct password')
        ]);
        parent::__construct();
    }
}